﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MVCPets.Extensions
{
  public static class Time
  {
    public static TimeSpan ConvertCoursewareTime(this double dt)
    {
      var hours = (int)(dt);
      var minutes = (int)((dt - (int)(dt)) * 60);
      var seconds = (int)Math.Round(((dt - (int)(dt)) * 60 - minutes) * 60);
      return new TimeSpan(hours, minutes, seconds);
    }
  }
}
